import 'babel-polyfill';
import React, { Component } from 'react';
import ReactDOM from 'react-dom';
import { Router, Route, IndexRoute, Link } from '$router';
import HomePage from './home';
import yoHistory from '../common/history';

const List = require.async('./list');
const Detail = require.async('./detail');
const Skill = require.async('./list/skill');
const Item = require.async('./card/item');
const My = require.async('./my');
const Express = require.async('./express');
const Root = () => (
    <Router history={yoHistory}>
        <Route path="/" component={HomePage}>
            <IndexRoute getComponent={Skill}/>
            <Route path="/list" getComponent={List}/>
            <Route path="/detail" getComponent={Detail}/>
            <Route path="/card/item" getComponent={Item}/>
            <Route path="/my" getComponent={My}/>
            <Route path="/express" getComponent={Express}/>
        </Route>
    </Router>
);

ReactDOM.render(<Root/>, document.getElementById('root'));
